<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function task1(){
             return new Promise((resolve,reject)=>{
            setTimeout(function(){
            console.log("搜索商品");
            resolve('华为mate60');
           },2000);
          });
        }
        function task2(){
             return new Promise((resolve,reject)=>{
            setTimeout(function(){
            console.log("下单购买");
            resolve(6000);
           },2000);
          });
        }
        function task3(){
             return new Promise((resolve,reject)=>{
            setTimeout(function(){
            console.log("取快递");
            resolve('订单:124300028');
           },2000);
          });
        }
       task1().then(function(v){
        console.log('准备购买',v);
        return task2();
       }).then(function(v){
        console.log('购买成功，费用',v);
        return task3();
       }).then(function(v){
        console.log('取快递成功,订单号是',v);
       })

    </script>
</body>
</html>